package org.grottarossa.ui.core.controls.skiptask;


import java.util.ResourceBundle;

import org.grottarossa.template.data.pojo.tasks.Task;
import org.grottarossa.ui.core.ApplicationSession;
import org.grottarossa.ui.core.i18n.DM;

/***
 * Factory per la creazione di controlli per lo skip di un task
 * @author 
 *
 */
public class SkipTaskFactory
{
	private final ApplicationSession m_appSession;

	public SkipTaskFactory(ApplicationSession appSession)
	{
		this.m_appSession = appSession;

	}

	/***
	 * Crea un controllo per lo skip di un task
	 * @param task
	 * @return
	 */
	public SkipTask createSkipTask(Task task)
	{
		ResourceBundle localizer = DM.instance().getBundle(getClass().getPackage().getName() + ".Resources");
		SkipTask view = new SkipTask(m_appSession, localizer);
		SkipTaskPresenter presenter = new SkipTaskPresenter(m_appSession, view, localizer, task);
		presenter.initialize();
		return view;
	}
}
